import Http from "~/apis/utils/http";

class CmsInformation extends Http {
  async filterData(params?: any) {
    return await this.post("information/filter", params);
  }

  deleteById(id: any) {
    return this.delete(`information/delete/${id}`);
  }

  deleteMany(ids: any) {
    return this.post("information/deleteMany", ids);
  }

  update(model: any) {
    return this.post("information/update", model);
  }

  create(model: any) {
    return this.post("information/create", model);
  }

  getNewsByCateKey(pageIndex: number, pageSize: number, identityKey: any) {
    return this.get("information/categoryKey", {
      pageIndex: pageIndex,
      pageSize: pageSize,
      identityKey: identityKey,
    });
  }

  getCategoryInfoByCateKey(identityKey: any) {
    return this.get("informationCategory/categoryKey", {
      identityKey: identityKey,
    });
  }

  getById(id: any) {
    return this.get(`information/query/${id}`);
  }
}

export default new CmsInformation();
